#include "PlatformProperty.h"
//自定义按键自动泊车
VENDOR_READ_PROPERTY(CUSTOM_KEY_TYPE_APA, int32_t) {
    builder.area(VehicleArea::GLOBAL)
            .initValue([]() {
                return 0;
            })
            .withStatusBySignals([]([[maybe_unused]] const PropertyStatus &last) {
                int carconfig142= (int32_t)(SIGNAL.getcarconfig142());
                VHALOG.d("halWithStatusBySignals CUSTOM_KEY_TYPE_APA : carconfig142[%d] usgmod[%d] carmod[%d] ",
                    carconfig142, toInt(SIGNAL.getVehModMngtGlbSafe1UsgModSts()),
                    toInt(SIGNAL.getVehModMngtGlbSafe1CarModSts1()));
                if (carconfig142 == 0x80) {
                    if (SIGNAL.usgModeIs(sdb::UsgModSts1::UsgModActv,sdb::UsgModSts1::UsgModDrvg,sdb::UsgModSts1::UsgModCnvinc) &&
                       SIGNAL.carModeIs(sdb::CarModSts1::CarModNorm)){
                       VHALOG.d("halWithStatusBySignals CUSTOM_KEY_TYPE_APA : Active ");
                       return PropertyStatus::Active;
                    } else {
                        VHALOG.d("halWithStatusBySignals CUSTOM_KEY_TYPE_APA : NotActive ");
                        return PropertyStatus::NotActive;
                    }
                } else {
                    VHALOG.d("halWithStatusBySignals CUSTOM_KEY_TYPE_APA : NotAvailable ");
                    return PropertyStatus::NotAvailable;
                }
            },SignalRX::VehModMngtGlbSafe1UsgModSts,SignalRX::VehModMngtGlbSafe1CarModSts1,SignalRX::carconfig142);
}